<!-- 单规则 -->
<template>
  <div class="SingleRule">
    <el-radio v-model="radio" label="1">单规格</el-radio>
    <el-button @click="last">sdesrf</el-button>
    <el-radio v-model="radio" label="2" @click="last">多规格</el-radio>
    <!-- 表格 -->
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="img" label="照片" width="">图片 </el-table-column>
      <!-- 售价 -->
      <el-table-column prop="prices" label="售价" width="">
        <template slot-scope="scope">
          <el-input v-model="scope.row.prices" />
        </template>
      </el-table-column>
      <!--成本价  -->
      <el-table-column prop="Costprice" label="成本价">
        <template slot-scope="scope">
          <el-input v-model="scope.row.Costprice" />
        </template>
      </el-table-column>
      <!-- 原价 -->
      <el-table-column prop="originalprice" label="原价">
        <template slot-scope="scope">
          <el-input v-model="scope.row.originalprice" />
        </template>
      </el-table-column>
      <!-- 库存 -->
      <el-table-column prop="stock" label="库存">
        <template slot-scope="scope">
          <el-input v-model="scope.row.stock" />
        </template>
      </el-table-column>
      <!-- 商品编号 -->
      <el-table-column prop="Commoditycode" label="商品编号">
        <template slot-scope="scope">
          <el-input v-model="scope.row.Commoditycode" />
        </template>
      </el-table-column>
      <!-- 重量（KG） -->
      <el-table-column prop="weight" label="重量（KG）">
        <template slot-scope="scope">
          <el-input v-model="scope.row.weight" />
        </template>
      </el-table-column>
      <!-- 体积（m） -->
      <el-table-column prop="volume" label="体积（m）">
        <template slot-scope="scope">
          <el-input v-model="scope.row.volume" />
        </template>
      </el-table-column>
    </el-table>
    <!-- <button @click="tableDatas">asxaq</button> -->
  </div>
</template>

<script>
export default {
  name: 'SingleRule',
  SingleRule: {
    last() {
      console.log(1)
      this.$router.push('/shop/many')
    }
  },

  // import引入的组件需要注入到对象中才能使用
  components: {},

  data() {
    // 这里存放数据

    return {
      radio: '1'
    }
    return {
      tableData: [
        {
          img: '0',
          prices: '0',
          Costprice: '0',
          originalprice: '0',
          stock: '0',
          Commoditycode: '0',
          weight: '0',
          volume: '0'
        }
      ]
    }
  },

  // 监听属性 类似于data概念
  computed: {},
  // 监控data中的数据变化
  watch: {},
  // 生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  // 生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  // 方法集合
  methods: {
    tableDatas() {
      let isNull = false
      this.tableData.map((item) => {
        const keys = Object.keys(item)
        keys.map((k) => {
          if (item[k]) {
            isNull = true
          } else {
          }
        })
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.SingleRule {
  width: 100%;
  height: 100%;
  padding: 0 5%;
  padding-top: 15px;
}
</style>
